package com.time.timespace.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.time.timespace.commons.constant.BaseConstants;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @author mjw
 * @date 2024/06/27
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "用户表")
@TableName("ts_user")
public class User implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    @Schema(description = "用户id")
    private Long userId;

    @Schema(description = "用户登陆名称")
    private String userName;

    @Schema(description = "别名，显示用")
    private String nickName;

    @Schema(description = "密码(加密)")
    private String password;

    @Schema(description = "用户头像")
    private String avatar;

    @Schema(description = "邮箱地址")
    private String email;

    @Schema(description = "删除标识，Y表示删除，N表示未删除")
    private String deleteFlag;

    @Schema(description = "创建日期")
    @JsonFormat(pattern = BaseConstants.Pattern.DATE_TIME)
    @DateTimeFormat(pattern = BaseConstants.Pattern.DATE_TIME)
    private Date creationDate;

    @Schema(description = "生日")
    private String birthday;

    @Schema(description = "个性签名")
    private String signature;

    @TableField(exist = false)
    private BigDecimal inChargeAmount;
    @TableField(exist = false)
    private BigDecimal outChargeAmount;
}
